package paperockscissors;

import java.util.ArrayList;
import java.util.Random;

public class Player {
	private String name;
	private int score;
	private ArrayList<RPSEnum> listMove;
	
	public Player(String name, ArrayList<RPSEnum> listMove){
		this.name=name;
		this.listMove=listMove;
		this.score=0;//not mandatory
	}
	
	public Player(String name){
		this.name=name;
		this.score=0;
		this.listMove = new ArrayList<RPSEnum>();
		Random rand = new Random();
		for(int i=0;i<10;i++){
			 switch(rand.nextInt(3)){
			 case 0:
				 listMove.add(RPSEnum.PAPER);
				 break;
			 case 1:
				 listMove.add(RPSEnum.SCISSORS);
				 break;
			 case 2:
				 listMove.add(RPSEnum.ROCK);
				 break;
			 }
		}
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getScore() {
		return score;
	}

	public void setScore(int score) {
		this.score = score;
	}
	
	public int getTotalMoves(){
		return this.listMove.size();
	}
	
	public RPSEnum getNextMove(){
		return this.listMove.listIterator().next();
	}
	
}
